using Dapper.Contrib.Extensions;
using Publicuse.Entity.AttributeUtil;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Publicuse.Entity
{
    /// <summary>
    /// 组织管理
    /// </summary>
    [DBTable("`geeker-organization`", "组织管理")]
    [Table("`geeker-organization`")]
    [SugarTable("`geeker-organization`")]
    public class Organization : BaseModel<long>
    {
        [Remark("名称")]
        public string name { get; set; }

        [Remark("排序")]
        public string order { get; set; }

        [Remark("上级")]
        public string parentId { get; set; }

        [SugarColumn(IsIgnore = true)]
        public List<Organization> children { get; set; }

        public Organization()
        {
            this.Id = 0;
        }
    }

    /// <summary>
    /// 登录用户信息查询参数
    /// </summary>
    public class OrganizationQuery : CommonQuery
    {

        public OrganizationQuery()
        {
            this.exportName = GetExportName;
            this.businessType = BusinessType.organization;
        }

        public static string GetExportName
        {
            get { return "organization"; }
        }
    }
}
